<%--
  Created by IntelliJ IDEA.
  author: Jsonor
  date: 2018/3/20 16:32
  description: Description
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
  <title>Title</title>
  <style>
    #tj{
      width: 800px;
      height: 40px;
      font-size: 20px;
      padding-right: 50px;
      margin: 0px auto;
      text-align: right;
    }
  </style>
</head>
<body>
<h1 align="center">城市信息</h1>
<br>
<div align="center">
  <form action="${pageContext.request.contextPath}/search.do">
  Country Code<input type="text" placeholder="CountryCode" name="condition">
  <input type="submit" value="搜索">
</form>
</div>

<div id="tj">
  <a href="${pageContext.request.contextPath}/views/countryAdd.jsp" >添加</a>
</div>

<table border="1" align="center" cellspacing="0">
 <tbody>
 <tr>
   <td>Code</td>
   <td>Name</td>
   <td>Region</td>
   <td>SurfaceArea</td>
   <td>IndepYear</td>
   <td>Population</td>
   <td>LifeExpectancy</td>
   <td>GNP</td>
   <td>HeadOfState</td>
   <td>Capital</td>
   <td>Code2</td>
   <td>Function</td>
 </tr>
 <c:forEach var="p" items="${country}">
   <tr>
   <td>${p.code}</td>
   <td>${p.name}</td>
   <td>${p.region}</td>
   <td>${p.surfaceArea}</td>
   <td>${p.indepYear}</td>
   <td>${p.population}</td>
   <td>${p.lifeExpectancy}</td>
   <td>${p.gnp}</td>
   <td>${p.headOfState}</td>
   <td>${p.capital}</td>
   <td>${p.code2}</td>
     <td>
       <a href="${pageContext.request.contextPath}/updateUI.do?code=${p.code}">修改</a>
       <a href="${pageContext.request.contextPath}/delete.do?code=${p.code}" onclick="return confirm('确认是否删除')">|删除</a>

     </td>
   </tr>
 </c:forEach>
 </tbody>
</table>
</body>
</html>
